package src.com.itheima.service;

import com.itheima.domain.Classes;
import com.itheima.mapper.ClassesMapper;
import com.itheima.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

public class StudentServiceTest {
    //查询全部
    @Test
    public void findAll() {
        //1.获取SqlSession对象
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        //2.获取mapper的代理对象
        ClassesMapper mapper = sqlSession.getMapper(ClassesMapper.class);
        //3.调用代理对象方法
        List<Classes> list = mapper.findAll();


        for (Classes student : list) {
            System.out.println(student);
        }
        sqlSession.close();
    }







}
